package com.deeper.customview.ui.c2.demo.c02d01;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.deeper.customview.BaseFragment;
import com.deeper.customview.R;

import java.util.Timer;
import java.util.TimerTask;

public class Chapter02Demo01Fragment extends BaseFragment {

    private BallMoveView ball;


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_chapter02_demo01, container, false);

        ball = root.findViewById(R.id.ball);
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                ball.postInvalidate();
            }
        }, 200, 50);

        return root;
    }
}
